package com.rd.student.jike.class1.fangzhou.day0807;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;

public class TestDaletou {
    public static void main(String[] args) throws IOException {
        zhongjiangNum();
    }
    public static void zhongjiangNum() throws IOException {
        File file = new File("daletou.txt");
        Writer writer = new FileWriter(file);
        ArrayList<Integer> List01 = new ArrayList<>(5);
        ArrayList<Integer> List02 = new ArrayList<>(2);
        for (int i = 0; i < 5;) {
            int random = (int) (Math.random() * 36 + 1);
            if (!List01.contains(random)) {
                List01.add(random);
                i++;
            }
        }
        for (int i = 0; i < 2;) {
            int random = (int) (Math.random() * 12 + 1);
            if (!List02.contains(random)) {
                List02.add(random);
                i++;
            }
        }
        String daletou = "";
        for(int i = 0;i < 5;i++){
            int num = List01.get(i);
            if(num<10){
                daletou += "0";
            }
            daletou += num + " ";
        }
        daletou += "|" + " ";
        for(int i = 0;i < 2;i++){
            int num = List02.get(i);
            if(num<10){
                daletou += "0";
            }
            daletou += num + " ";
        }
        System.out.println(daletou);
        writer.write(daletou);
        writer.close();
    }
}
